import re, sys, time, pprint, random
from instances import instances
from abstracts import abstracts

def main(dct, fname, N):
   with open(fname, "r", 1) as f:
      for i in range(N):
         item = random.choice(dct.keys())
         offset = dct[item]
         f.seek(offset)
         line = f.readline()
         print item, offset, line

if __name__=='__main__':
   assert(len(sys.argv)==3)
   type = sys.argv[1]
   if type=='instances':
      dct = instances
   else:
      dct = abstracts
   fname = sys.argv[2]
   main(dct, fname, 10)
